How to mock Request.Files[] in MVC unit test class?
Posted
by kapil
on Stack Overflow
See other posts from Stack Overflow
or by kapil
Published on 2010-04-23T10:16:08Z
Indexed on
2010/04/25
20:33 UTC
Read the original article
Hit count: 518
I want to test a controller method in MVC unit test. For my controller method to test, I require a Request.Files[] collection with length one. I want to mock Request.Files[] as I have used a file upload control on my view rendered by controller method. Can anyone please suggest how can I mock request.file collection in my unit test.
thanks, kapil
© Stack Overflow or respective owner